Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#59] Add node states #60

Merged
merged 2 commits into from
Mar 3, 2024
Merged

[#59] Add node states #60

merged 2 commits into from
Mar 3, 2024

Conversation

maypok86
Copy link
Owner

@maypok86 maypok86 commented Mar 2, 2024

Description

A state has been added to each node. (Whether it was deleted from the hash table or not).
This will help filter events for eviction policy updates in the wrong order to avoid damaging the eviction policy.

Related issue(s)

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
  • Public contracts

    • My changes doesn't break project license.

Stylistic guide (mandatory)

  • My code complies with the styles guide.

  • My commit history is clean (only contains changes relating to my
    issue/pull request and no reverted-my-earlier-commit changes) and commit
    messages start with identifiers of related issues in square brackets.

    Example: [#42] Short commit description

    If necessary both of these can be achieved even after the commits have been
    made/pushed using rebase and squash.

Before merging (mandatory)

  • Check target branch of PR is set correctly

@maypok86 maypok86 force-pushed the maypok86/#59-node-state branch from 5069da5 to 6bb9e32 Compare March 2, 2024 20:12
@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 93.10345% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 95.62%. Comparing base (758caa3) to head (03b6bf0).

Files Patch % Lines
internal/core/cache.go 90.00% 3 Missing and 2 partials ⚠️
internal/s3fifo/small.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #60      +/-   ##
==========================================
+ Coverage   95.37%   95.62%   +0.25%     
==========================================
  Files          22       22              
  Lines        1232     1235       +3     
==========================================
+ Hits         1175     1181       +6     
+ Misses         39       36       -3     
  Partials       18       18              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maypok86
Copy link
Owner Author

maypok86 commented Mar 3, 2024

Damn, it seems like splitting isAlive checks between eviction and expiration policies was a bad idea. It looks like we need to refactor the code.

@maypok86 maypok86 force-pushed the maypok86/#59-node-state branch from edd28dd to 03b6bf0 Compare March 3, 2024 16:16
@maypok86
Copy link
Owner Author

maypok86 commented Mar 3, 2024

Yes, it looks better now.

@maypok86 maypok86 merged commit c66ac1f into main Mar 3, 2024
5 checks passed
@maypok86 maypok86 deleted the maypok86/#59-node-state branch March 3, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix the damage to the eviction policy if the order of events is incorrect.
2 participants